package org.my.business.controller.app.dept;

import lombok.RequiredArgsConstructor;
import org.my.business.controller.app.dept.vo.AppDeptCreateVO;
import org.my.business.service.IAppDeptService;
import org.my.common.core.domain.R;
import org.my.common.log.annotation.Log;
import org.my.common.log.enums.BusinessType;
import org.my.common.web.core.BaseController;
import org.my.system.mapper.SysDeptMapper;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * app 部门管理
 * @author JohnnyKang
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/business/dept")
public class AppDeptController extends BaseController {

    private final IAppDeptService appDeptService;
    /**
     * 新增部门
     */
    @Log(title = "部门管理", businessType = BusinessType.INSERT)
    @PostMapping("/create")
    public R<Void> add(@Validated @RequestBody AppDeptCreateVO createVO) {
        return toAjax(appDeptService.create(createVO));
    }
}
